
<div ng-form="ng-form" name="mirrorsListFrom" ng-class="{'need-valid':needValid.valid}" novalidate="novalidate" class="mod-deploy create-deploy1">
  <div class="mirror-con">
    <div select-con="select-con" event-type="focus" class="mirrror com-select-con"><span class="mirror-label">选择镜像</span>
      <input placeholder="搜索镜像" ng-model="mirKey" class="mirror-txt search-txt ui-btn-select"/><i class="icon-search"></i><span class="mirror-button"><a ng-click="deployEditIns.addOtherImage()" class="link-safe">其他镜像</a></span>
      <div class="select-list">
        <ul>
          <li ng-if="imageFiltered.length===0"><a>无相关镜像信息</a></li>
          <li ng-repeat="image in imageFiltered=(deployEditIns.imageList|filter:{'imageName':mirKey})" class="select-item"><a ng-click="deployEditIns.addImage(image)" ng-cloak="ng-cloak">{{image.imageName}}<span ng-bind="image.registry" class="txt-prompt pull-right"></span></a></li>
        </ul>
      </div>
    </div>
  </div>
  <p ng-if="!editConfig.containerDrafts||editConfig.containerDrafts.length===0" class="nomirror">您尚未选择任何镜像。</p>
  <div class="containerdrafts-con">
    <ul list-scroll="list-scroll" width-offset="150">
      <li disabled="true" class="nav-option"><span><a class="icon-last to-last"></a><a class="icon-next to-next"></a></span></li>
      <li ng-repeat="image in editConfig.containerDrafts" ng-cloak="ng-cloak" ng-click="currentContainerDraft.index=$index;" ng-class="{'active':currentContainerDraft.index===$index,'txt-error':needValid.valid&amp;&amp;mirrorsListFrom['Form'+$index].$invalid}">{{image.image}}<a ng-click="deleteImage($index);fresh()" class="icon-cancel"></a></li>
    </ul>
  </div>
  <div ng-repeat="image in editConfig.containerDrafts" ng-init="formName='Form'+$index;" ng-show="currentContainerDraft.index===$index">
    <ng-form role="form" name="{{formName}}" class="mirror-info-con">
      <ul class="mirror-info">
        <li><span class="info-name">镜像仓库</span>
          <div ng-bind="image.registry" class="info-content"></div>
        </li>
        <li><span class="info-name">镜像版本</span>
          <div class="info-content">
            <div select-con="select-con" class="com-select-con">
              <button ng-cloak="ng-cloak" class="ui-btn ui-btn-white ui-btn-select"><i class="icon-down"></i>{{image.tag || '选择镜像版本'}}</button>
              <ul class="select-list">
                <li ng-repeat="tag in image.tagList" class="select-item"><a ng-click="deployEditIns.toggleImageTag($parent.$index,tag.tag)"><span ng-bind="tag.tag"></span><span ng-bind="parseDate(tag.createTime)" class="txt-prompt"></span></a></li>
              </ul>
            </div>
          </div>
        </li>
        <li><span class="info-name">运行过程环境变量</span>
          <div class="info-content">
            <table ng-show="image.oldEnv.length!==0" class="ui-table-primary ui-table-mirror">
              <thead>
                <tr>
                  <th>环境变量名</th>
                  <th>环境变量值</th>
                  <th>描述</th>
                </tr>
              </thead>
              <tbody>
                <tr ng-repeat="env in image.oldEnv">
                  <td ng-bind="env.key"></td>
                  <td class="tb-value">
                    <input ng-model="env.value" name="oldEnvValue" class="ui-input-fill"/>
                  </td>
                  <td ng-bind="env.description"></td>
                </tr>
              </tbody>
            </table>
            <ul class="env-list">
              <li ng-repeat="env in image.newEnv" ng-form="ng-form" name="childForm" class="env-line">
                <input placeholder="环境变量名" ng-pattern="/^[A-Za-z_][A-Za-z0-9_]*$/" name="key" ng-model="env.key" is-required="is-required" param1="{{env.value}}" param2="{{env.description}}" class="ui-input-fill"/>
                <input placeholder="环境变量值" name="value" ng-model="env.value" is-required="is-required" param1="{{env.key}}" param2="{{env.description}}" class="ui-input-fill"/>
                <input placeholder="描述20字以内" name="description" ng-model="env.description" class="ui-input-fill"/><a ng-click="deployEditIns.deleteImageEnv($parent.$index,$index)" class="icon-delete"></a>
              </li>
            </ul><span ng-click="deployEditIns.addImageEnv($index)" class="add-env"><i class="icon-add"></i></span>
          </div>
        </li>
        <li><span class="info-name">容器大小</span>
          <div class="info-content">CPU(个)
            <input ng-model="image.cpu" name="cpu" ng-pattern="/^(\d*\.)?\d+$/" required="required" class="ui-input-fill ui-input-sm"/>内存(MB)
            <input ng-model="image.mem" name="mem" ng-pattern="/^(\d*\.)?\d+$/" required="required" class="ui-input-fill ui-input-sm"/><span ng-if="(needValid.valid||mirrorsListFrom[formName].cpu.$dirty)&amp;&amp;mirrorsListFrom[formName].cpu.$invalid||(needValid.valid||mirrorsListFrom[formName].mem.$dirty)&amp;&amp;mirrorsListFrom[formName].mem.$invalid" class="tool-inline-error">请填写数字</span>
          </div>
        </li>
      </ul>
    </ng-form>
  </div>
  <div class="com-bottom-option text-center"><span class="com-bottom-option-con">
      <button ng-click="needValid.valid=true;mirrorsListFrom.$valid&amp;&amp;toNext()" class="ui-btn ui-btn-md ui-btn-bright">下一步</button><span ng-if="needValid.valid&amp;&amp;mirrorsListFrom.$invalid" class="txt-error">存在不合法数据，请修改后提交！</span></span></div>
</div>